package ru.papergames.model.binsocket.packets.request
{
	import ru.papergames.model.binsocket.data.ExtByteArray;
	import ru.papergames.model.binsocket.packets.SocketRequest;

	public class PingRequest extends SocketRequest
	{
		public static const NOTIFICATION:String = 'PingRequest';
		
		public static var ID:uint = 0;
		
		public var pingId:uint;
		
		public function PingRequest()
		{
			super(0xA1);
			pingId = (ID++)%256;
		}
		
		override protected function getPacketBody():ExtByteArray {
			var body:ExtByteArray = new ExtByteArray();
						
			body.writeByte(pingId);
			
			return body;
		}
		
		override public function getNotification():String {
			return NOTIFICATION;
		}
		
	}
}